package cz.af.portletExams.backend.rest;


import cz.af.portletExams.backend.ExamsOverViewBackendRest;
import org.springframework.util.Assert;

public class ExamsOverViewBackendRestTest {

    @org.junit.Test
    public void smokeTest() {
        final ExamsOverViewBackendRest examsOverViewBackendRest = new ExamsOverViewBackendRest(new ExamsClientHttpRequestFactory());
        examsOverViewBackendRest.init();

        Assert.isTrue(examsOverViewBackendRest.findExamIdsForUser("fiserale").size() == 9);
        Assert.isTrue(examsOverViewBackendRest.findExamsForSubject("MI-MDW").size() == 8);
        Assert.isTrue(examsOverViewBackendRest.findSubjectsForUsername("fiserale").size() == 8);
        Assert.isTrue(examsOverViewBackendRest.isUsernameValid("fiserale"));
        Assert.isTrue(!examsOverViewBackendRest.isUsernameValid("file"));
        Assert.isTrue(examsOverViewBackendRest.findExamsForUser("fiserale").size() == 9);
    }

}
